package com.shop.admin.controller;

import com.shop.Result.LdbzResult;
import com.shop.admin.service.AdminSearchSlideAdService;
import com.shop.pojo.LdbzSearchSlideAd;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/admin/searchS/service")
public class AdminSearchSlidAdController {

    private static final Logger logger = LoggerFactory.getLogger(AdminSearchSlideAdService.class);

    @Autowired
    private AdminSearchSlideAdService adminSearchSlideAdService;

    @RequestMapping(value="/editSearchSlideAd/{id}" , method = RequestMethod.GET)
    public LdbzResult editSearchSlideAd(@PathVariable("id")long id , Model model) {
        return adminSearchSlideAdService.selectByKey(id);
    }

    @RequestMapping(value="/getSearchSlideAdPage" , method = RequestMethod.GET)
    public LdbzResult getSearchSlideAdPage(LdbzSearchSlideAd entity , int page , int limit) {
        return adminSearchSlideAdService.getSearchSlideAdPage(entity, page, limit);
    }

    @RequestMapping(value="/selectByKey/{id}" , method = RequestMethod.GET)
    public LdbzResult selectByKey(@PathVariable("id")long id) {
        return adminSearchSlideAdService.selectByKey(id);
    }

    @RequestMapping(value="/deleteByKey/{id}" , method = RequestMethod.GET)
    public LdbzResult deleteByKey(@PathVariable("id")String id) {
        return adminSearchSlideAdService.deleteByKey(id);
    }

    @RequestMapping(value="/insertByEntity" , method = RequestMethod.GET)
    public LdbzResult insertByEntity(LdbzSearchSlideAd entity) {
        return adminSearchSlideAdService.insertByEntity(entity);
    }

    @RequestMapping(value="/updateByKey" , method = RequestMethod.GET)
    public LdbzResult updateByKey(LdbzSearchSlideAd entity) {
        return adminSearchSlideAdService.updateByKey(entity);
    }
}
